﻿using System;

namespace NodeJS
{
    public class Encoding
    {
        /// <summary>
        /// For 7 bit ASCII data only. This encoding method is very fast, and will strip the high bit if set.
        /// Note that when converting from string to buffer, this encoding converts a null character ('\0' or '\u0000') into 0x20 (character code of a space). If you want to convert a null character into 0x00, you should use 'utf8'.
        /// </summary>
        [EvalAtCompile]
        public const string Ascii = "ascii";

        /// <summary>
        /// Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
        /// </summary>
        [EvalAtCompile]
        public const string Utf8 = "utf8";

        /// <summary>
        /// 2 or 4 bytes, little endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported.
        /// </summary>
        [EvalAtCompile]
        public const string Utf16le = "utf16le";

        /// <summary>
        /// Alias of 'utf16le'.
        /// </summary>
        [EvalAtCompile]
        public const string Ucs2 = "ucs2";

        /// <summary>
        /// Base64 string encoding.
        /// </summary>
        [EvalAtCompile]
        public const string Base64 = "base64";

        /// <summary>
        /// A way of encoding raw binary data into strings by using only the first 8 bits of each character. This encoding method is deprecated and should be avoided in favor of Buffer objects where possible.
        /// This encoding will be removed in future versions of Node.
        /// </summary>
        [EvalAtCompile]
        [Obsolete]
        public const string Binary = "binary";

        /// <summary>
        /// Encode each byte as two hexadecimal characters.
        /// </summary>
        [EvalAtCompile]
        public const string Hex = "hex";
    }
}
